﻿Public Class PhongHocDAO
    Public Shared Function SelectAll() As DataTable
        Dim strSQL As String = "select * from PHONGHOC"
        Dim dt As DataTable
        dt = Provider.ExecQuery(strSQL)
        Return dt
    End Function

    Public Shared Sub Insert(ByVal _ph As PhongHocDTO)
        Dim strSQL As String = "Insert into PHONGHOC(TenPhong, DiaDiem)Values('" & _ph.TenPhong & "','" & _ph.DiaDiem & "')"
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Delete(ByVal _ph As PhongHocDTO)
        Dim strSQL As String = "delete from PHONGHOC where MaPhong = " & _ph.MaPhong
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Update(ByVal _ph As PhongHocDTO)
        Dim strSQL As String = "Update PHONGHOC set TenPhong = '" & _ph.TenPhong & "', DiaDiem = '" & _ph.DiaDiem & "' Where MaPhong = " & _ph.MaPhong
        Provider.ExecNoneQuery(strSQL)
    End Sub
End Class
